<template>
  <div>登录中，请勿刷新页面······</div>
</template>

<script setup>
import { ref, reactive, getCurrentInstance, nextTick } from "vue";
import { useRouter, useRoute } from "vue-router";
import {ElMessage} from "element-plus";
const proxy = getCurrentInstance().appContext.config.globalProperties;
const router = useRouter();
const route = useRoute();

function login() {
  proxy.$http.get(
      proxy.$url+'/qqLogin',
      {params:router.currentRoute.value.query}
  ).then(response=>{
    if(response.data.code===200){
      proxy.$cookie.set("userInfo",response.data.data.userInfo, "7d")
      proxy.$cookie.set("token",response.data.data.token, "7d")
      router.push('/home')
    }else{
      ElMessage({
        type: "error",
        message: response.data.msg,
        duration: 2000
      })
    }
  })
}
login()

</script>

<style lang="scss" scoped>
</style>
